package com.sky.mapper;

import com.sky.entity.Dish;
import com.sky.entity.Setmeal;
import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.*;

import java.awt.*;
import java.util.List;

@Mapper
public interface ShoppingCartMapper {


    /**
     * 根据条件查询购物车中的数据
     * @param shoppingCart
     * @return
     */
    List<ShoppingCart> findByCondition(ShoppingCart shoppingCart);

    /**
     * 插入购物车数据
     * @param shoppingCart
     */
    void insert(ShoppingCart shoppingCart);

    /**
     * 更新购物车数据
     * @param shoppingCart
     */
    void update(ShoppingCart shoppingCart);

    /**
     * 根据id或者userId删除购物车数据
     * @param cart
     */
    void delete(ShoppingCart cart);
    @Delete("delete from shopping_cart where id=#{id}")
    void deleteById(Long id);

    void insertBatch(List<ShoppingCart> shoppingCartList);
}
